{{partial('public/header')}}

<div class="midder">
<div class="mc">
	<h1  id="image">{{seo.title}}</h1>
	<div class="cleft">

<div class="pl photitle">
        <span class="fr">&gt; <a href="{{url('space/photos/album/'~strPhoto['albumid'])}}">返回相册</a></span>
        <span class="fl">第{{strPhoto['nowPage']}}张 / 共{{strPhoto['countPage']}}张</span>
        {% if strPhoto['nowPage']>1 %}
        <a id="pre_photo" title="上一张" href="{{strPhoto['prevturl']}}#image">上一张</a>
        	 {% if strPhoto['nowPage'] < strPhoto['countPage'] %}
        		&nbsp;&nbsp;/&nbsp;&nbsp;
             {% endif %}
        {% endif %}
        {% if strPhoto['nowPage'] < strPhoto['countPage'] %}
        <a id="next_photo" title="下一张" href="{{strPhoto['nexturl']}}#image">下一张</a>
        {% endif %}
</div>
    
<div id="link-report">
      <div style="text-align:center">
       {% if strPhoto['nowPage'] < strPhoto['countPage']%}
          <a title="点击查看下一张" href="{{strPhoto['nexturl']}}#image" class="mainphoto">
              <img src="{{strPhoto['mimg']}}">
          </a>
       {% else %}
       		 <img src="{{strPhoto['mimg']}}">  
       {% endif %}   
      </div>
      <div class="photo_descri" style="padding-left:0px; padding-right:0px">
           <p class="pl" id="desc_info">
           <span>
           {% if strPhoto['photodesc'] %}
           		{{strPhoto['photodesc']}}
           {% else %}
           这张照片的还没有添加任何描述...
           {% endif %}
           </span>
           &nbsp;
           {% if visitor['userid'] == strPhoto['userid'] %}
           &gt;&nbsp;<a title="编辑描述" href="javascript:;" id="edit_pinfo">编辑描述</a>
           {% endif %}
           </p>
           
           {% if visitor['userid'] == strPhoto['userid'] %}
           <p class="pl" id="desc_edit" style="display:none">
               <textarea maxlength="120" name="photodesc" id="photodesc" style="width:100%; margin-bottom:5px; color:#666" class="txt">{{strPhoto['photodesc']}}</textarea>
               <br/>
               <input type="button" value="保存" class="subab" id="savebtn">&nbsp;&nbsp;<a href="javascript:;" id="cancle_edit">取消</a>
           </p>
           {% endif %}
           
      </div>
      <div class="report-link" style="color:#999;margin-bottom:5px">
      		{% if visitor['userid'] == strPhoto['userid'] %}
            <span class="fr">&gt;&#12288;<a title="删除这张照片" href="{{url('space/photos/delphoto/'~strPhoto['photoid'])}}" onClick="return confirm('真的要删除吗？')" >删除照片</a></span>
            {% endif %}
            {{strPhoto['count_view']}}人浏览&#12288;&#12288;上传于{{date('Y-m-d H:i:s',strPhoto['addtime'])}}&#12288;<a target="_blank" title="查看原图" href="{{strPhoto['img']}}">查看原图</a>
      </div>
    
</div>

    <div class="mod">
       {{hook('Comment','show',['visitor':visitor, 'params':params])}}
    </div>
    
<script language="javascript">
	$('#edit_pinfo').bind('click',function(){
		var desc_info = $('#desc_info'),desc_edit = $('#desc_edit');
		desc_info.hide();desc_edit.show();
	});
	$('#cancle_edit').bind('click',function(){
		var desc_info = $('#desc_info'),desc_edit = $('#desc_edit');
		desc_info.show();desc_edit.hide();
	});
	$('#savebtn').bind('click',function(){
		var info = $('#photodesc'),pid = '{{strPhoto["photoid"]}}',ajaxurl='{{url("space/photos/editphoto")}}';
		var desc_info = $('#desc_info'),desc_edit = $('#desc_edit');
		if(info.val()=="" || info.val() == 0){
			tips('描述不能为空字符')
		}else{
			$.post(ajaxurl,{photoid:pid,photodesc:info.val()},function(res){
				if(res.r==1){
					desc_info.show();desc_edit.hide();
					desc_info.find('span').html(res.html);
					info.val(res.html);
				}else{
					tips(res.error)
				}
			});
		}
	})
</script>    
    	
    </div><!--//cleft-->
    <div class="cright">
       
<div class="mod">
        
    <h2>
    	{% if visitor['userid'] == strPhoto['userid'] %}
        我的相册&nbsp;·&nbsp;·&nbsp;·&nbsp;·&nbsp;·&nbsp;·
        {% else %}
        {{strUser['username']}}的相册&nbsp;·&nbsp;·&nbsp;·&nbsp;·&nbsp;·&nbsp;·        
        {% endif %}
        <span class="pl">&nbsp;(<a href="{{url('space/'~strUser['doname']~'/photos')}}">全部</a>) </span>
    </h2>

        <div class="bd">
            <ul class="album-list">
                    {% for item in arrAlbum %}
                    <li>
                    <div class="pic">
                        <a href="{{url('space/photos/album/'~item['albumid'])}}">
                            <img width="75" height="75" alt="{{item['albumname']}}" src="{{item['simg']}}">
                        </a>
                    </div>
                    <div class="info">
                        <a href="{{url('space/photos/album/'~item['albumid'])}}">{{item['albumname']}}</a>
                        <span class="num">{{item['count_photo']}}张照片</span>
                        <p>{{sub_str(clearText(item['albumdesc']),60)}}</p>
                    </div>
                    </li>
  					{% endfor %}		    
            </ul>
        </div>
    </div>		
        
    </div><!--//right-->
</div>
</div>

